| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× | var https = require("https");
module.exports = {
printName(person) {
return `${person.last}, ${person.first}`;
},
loadWiki(person, callback) {
var url = `https://en.wikipedia.org/wiki/${person.first}_${person.last}`;
https.get(url, function(res) {
var body = "";
res.setEncoding("UTF-8");
res.on("data", function(chunk) {
body += chunk;
});
res.on("end", function() {
callback(body);
});
});
}
}; |